package com.enation.app.base.core.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.enation.app.base.core.model.PluginDataMapper;
import com.enation.app.base.core.plugin.testplugin.TestPluginBundle;

@Scope("prototype")
@Controller
@RequestMapping("/core/admin/setting")
public class TestAction {

	@Autowired
	private TestPluginBundle testPluginBundle;

	@RequestMapping(value = "/test")
	public ModelAndView onShowHtml() {
		System.out.println("执行");

		ModelAndView view = new ModelAndView();
		List<PluginDataMapper> tabTitleList = this.testPluginBundle
				.getTabList();
		List<PluginDataMapper> tabHtmlList = this.testPluginBundle
				.getDetailHtml();

		view.addObject("tabs", tabTitleList);
		view.addObject("htmls", tabHtmlList);
		view.setViewName("/core/admin/setting/test");

		return view;
	}

}
